/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* E.P. Scene Graph
* Developed by:
*       - Eduardo Ribeiro (eribeiro @ tecgraf . puc-rio . br)
*       - Peter Dam (peter @ tecgraf . puc-rio . br)
* File: Cube.h
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef _EPSG_CUBE_
#define _EPSG_CUBE_

#include "EPSG/Vec3.h"
#include "EPSG/Shape.h"
#include <vector>

namespace EPSG
{
	class Cube : public Shape
	{
	public:
		/* [CONSTRUCTOR] */	Cube();
		/* [CONSTRUCTOR] */	Cube( float dx, float dy, float dz );

		virtual void		draw( bool autoTexCoord = true );

		void				setDimensions( float dx, float dy, float dz );
		void				setSegments( int sx, int sy, int sz );

	private:
		void				drawWithAutoTexCoord();
		void				drawWithNoTexCoord();

		void				tesselate();

		float				_dx;
		float				_dy;
		float				_dz;

		float				_positiveX, _negativeX;
		float				_positiveY, _negativeY;
		float				_positiveZ, _negativeZ;

		int					_segX;
		int					_segY;
		int					_segZ;

		std::vector<Vec3<float>> _faceXY;
		std::vector<Vec3<float>> _faceXZ;
		std::vector<Vec3<float>> _faceZY;
	};
}

#endif //_EPSG_CUBE_